package com.bac.rentmap.ad.flat.rating.item;

import com.bac.rentmap.ad.flat.FlatAd;

public class EmailRatingItemCalculator implements RatingItemCalculator {
    private static final int MIN_POSSIBLE_RATING = 0;
    private static final int MAX_POSSIBLE_RATING = 100;

    @Override
    public long calculate(FlatAd flatAd) {
        return (flatAd.getExternal() || flatAd.getEmail() != null) ? MAX_POSSIBLE_RATING : MIN_POSSIBLE_RATING;
    }

    @Override
    public long getMaxPossibleRating() {
        return MAX_POSSIBLE_RATING;
    }

    @Override
    public long getMinPossibleRating() {
        return MIN_POSSIBLE_RATING;
    }
}
